<%@ page import="cn.ecut.User" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: lujiapeng
  Date: 2020/9/15
  Time: 17:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>EL表达式</title>
</head>
<body>
<div>
</div>
<%
    User user = new User() ;
    user.setPassword("123123");
    user.setName("张三");

    User user2 = new User() ;
    user.setName("lisi");
    user.setPassword("456789");

    User user3 = new User() ;
    user.setName("王五");
    user.setPassword("456789");

    User user4 = new User() ;
    user.setName("赵六");
    user.setPassword("456789");

    List<User> list = new ArrayList<>() ;
    list.add( user ) ;
    list.add( user2 ) ;
    list.add( user3 ) ;
    list.add( user4 ) ;

    // 将 集合存放在 一个区域中
    request.setAttribute("userList" , list );

%>
<%-- 当前 获取到的 userList 不为空 --%>
${ not empty userList}
${ userList }

</body>
</html>
